import * as THREE from "three";


export const StoreGroup=(option,num)=>{
  let optionOpacity=0.3;
  let optionColor=0xF5B8B8;
  let optionType='StoreGroup';
  let optionCube = {
    length: option.length+num,
    width: option.width+num,
    height: option.height+num*1.5,
    position: {
      x: option.position.x,
      y: option.position.y,
      z: option.position.z
    },
    style: {
      transparent:1,
      opacity:optionOpacity,
      color: optionColor,
      depthTest:0
    },
  };

  let cubeGeometry = new THREE.BoxGeometry(optionCube.length, optionCube.height, optionCube.width);
  let meshPhongMaterial = new THREE.MeshPhongMaterial({
    transparent:true,
    opacity:optionCube.style.opacity,
    color:optionCube.style.color,
    depthTest:false
  });
  let mesh = new THREE.Mesh(cubeGeometry,meshPhongMaterial);
  mesh.uuid=option.no;
  mesh.name=option.group_name;
  mesh.type=optionType
  mesh.position.x=optionCube.position.x;
  mesh.position.y=optionCube.position.y;
  mesh.position.z=optionCube.position.z;

  return mesh;
}
